<%@ page contentType="text/html; charset=UTF-8" language="java"
	import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/page/base.jsp"%>
<script type="text/javascript" src="<%=path%>/manage/js/jquery.ztree.core-3.5.min.js"></script>
<script type="text/javascript" src="<%=path%>/manage/js/jquery.ztree.excheck-3.5.min.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/manage/css/zTreeStyle/zTreeStyle.css" />
<script type="text/javascript">
var zNodes;
var zTree;
var settings = {
	check : {
		autoCheckTrigger: true,
		chkboxType: { "Y": "s", "N": "ps" },
		enable: true,
		chkStyle: "checkbox"
	},
	view : {
		dblClickExpand : false,
		showLine : true,
		showIcon : false,
		selectedMulti : false,
		expandSpeed : ($.browser.msie && parseInt($.browser.version) <= 6) ? ""
				: "fast"
	},
	data : {
		simpleData : {
			enable : true,
			idKey : "id",
			pIdKey : "pId",
			rootPId : ""
		}
	},
	callback : {
		beforeClick : function(treeId, treeNode) {
			var zTree = $.fn.zTree.getZTreeObj("tree");
			if (treeNode.isParent) {
				zTree.expandNode(treeNode);
				//demoIframe.src="${pageContext.request.contextPath}/dataBinding/getAppCatelogById.action?id="+ treeNode.id;
				//statusProcess();
				return true;
			} else {
				//叶子节点不处理
				//demoIframe.src="${pageContext.request.contextPath}/dataBinding/getAppContent.action?intCateId="+ treeNode.id;
				//statusProcess();
				return true;
			}
		}
	}
};
$(document).ready(function() {
	createTree("${pageContext.request.contextPath}/dataBinding/getAppCatlogTree.action",settings);
});
function createTree(url,set) {
    $.ajax({
        url: url,
        type: 'POST',
        async:false,
        dataType: "json",
        success: function(data) {
            zNodes = data;
            $.fn.zTree.init($("#tree"), set, zNodes);
        },
        error: function(msg) {
            alert("加载分类树失败，请重试");
        }
    });
}
</script>
<ul id="tree" class="ztree"></ul>